package com.isunland.managesystem.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

/**
 * 对象功能: 租赁设备
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2017/2/16 13:45
 */

public class LeaseEquipmentListActivity extends SingleFragmentActivity {

  private String mainId;//租赁主表id
  private String status;//数据状态
  private boolean isUpdate;//是否是更新操作

  public static void newInstance(android.support.v4.app.Fragment fragment, Activity context,
      String mainId, String status, int requestCode, boolean isUpdate) {
    if (fragment == null || context == null) return;
    Intent i = new Intent(context, LeaseEquipmentListActivity.class);
    i.putExtra(LeaseEquipmentListFragment.EXTRA_MAINID, mainId);
    i.putExtra(LeaseEquipmentListFragment.EXTRA_STATUS, status);
    i.putExtra(LeaseEquipmentListFragment.EXTRA_IS_UPDATE, isUpdate);
    fragment.startActivityForResult(i, requestCode);
  }

  @Override protected void onCreate(Bundle arg0) {
    mainId = getIntent().getStringExtra(LeaseEquipmentListFragment.EXTRA_MAINID);
    status = getIntent().getStringExtra(LeaseEquipmentListFragment.EXTRA_STATUS);
    isUpdate = getIntent().getBooleanExtra(LeaseEquipmentListFragment.EXTRA_IS_UPDATE, false);
    super.onCreate(arg0);
  }

  @Override protected Fragment createFragment() {
    return LeaseEquipmentListFragment.newInstance(mainId, status, isUpdate);
  }
}
